package com.moyq5.mvcmaker;

import java.util.ArrayList;
import java.util.List;

/**
 * 项目开发辅助模块，自动化生成项目内容，如dao,servie,controller,json等
 * @author Moyq5
 * @date 2018年8月24日
 */
public class App {
	public static void main(String[] args) {
		
		String path = App.class.getClassLoader().getResource("/").getPath();
		System.out.print("项目目录");
		System.out.println(path);
		
		ProjectExample pj = new ProjectExample();
		pj.setPack("com.sanstar.iot");
		pj.setPath(App.class.getClassLoader().getResource("/").getPath());
		
		BeanModule bm = new BeanModule(pj, "sanstar-iot-core-bean", "common");
		ServiceModule sm = new ServiceModule(pj, "sanstar-iot-core-service", "common");
		WebModule dataServer = new WebModule(pj, "sanstar-iot-core-service", "data.server");
		List<WebModule> list = new ArrayList<WebModule>();
		list.add(dataServer);
		
		pj.setBeanModule(bm);
		pj.setServiceModule(sm);
		pj.setWebModules(list);
		
		try {
			MvcMakerFactory.execute(pj);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//MvcMakerFactory.updateMixInFactory(pj);
	}
	
}
